package be.novelfaces.component.util.element;

public enum ElementType {
	
	INPUT("input"),
	SPAN("span", true),
	DIV("div", true),
	ADDRESS("address", true),
	ARTICLE("article", true),
	ASIDE("aside", true),
	SECTION("section", true),
	NAV("nav", true),
	HGROUP("hgroup", true),
	HEADER("header", true),
	FOOTER("footer", true),
	H1("h1", true),
	H2("h2", true),
	H3("h3", true),
	H4("h4", true),
	H5("h5", true),
	H6("h6", true);
	
	private String name;
	private boolean panel;

	private ElementType(String name) {
		this.name = name;
		this.panel = false;
	}
	
	private ElementType(String name, boolean panel) {
		this.name = name;
		this.panel = panel;
	}

	public String getName() {
		return name;
	}
	
	public boolean isPanel() {
		return panel;
	}
	
	public static ElementType from(String name) {
		for (ElementType type : ElementType.values()) {
			if(type.getName().equals(name)) {
				return type;
			}
		}
		throw new IllegalArgumentException("No elemenType found for name: " + name);
	}
	
}
